All Functions Used on PO12Q

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

setwd

{base}

Set Working Directory

prop.test

{stats}

Test of Equal or Given Proportions

log

{base}

log (default base = e)

ylab

{GGPLOT2}

Label the y axis (ggplot)

read_excel

{readxl}

Read an Excel file

prop.table

{base}

Transform frequency table into table of proportions

coeftest

{lmtest}

Inference for Estimated Coefficients

c

{base}

Combine values/vectors into a vector

rm

{base}

Remove objects

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

bptest

{lmtest}

Breusch-Pagan Test for Homoscedasticity

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

geom_point

{GGPLOT2}

Generates a scatter plot

read_dta

{haven}

Read a .dta file (Stata data)

vif

{car}

Calculate Variance Inflation Factor

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

ordered

{dplyr}

Create an ordered factor

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

set.seed

{base}

Initialise a pseudorandom number generator.

with

{base}

evaluate expression in the context of a data frame

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

nobs

{gdata}

Compute the number of non-missing observations

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

library

{base}

Load an R package

levels

{base}

Get levels of a factor

cut

{base}

Convert Numeric to Factor

recode

{dplyr}

Recode a variable

xlab

{GGPLOT2}

Label the x axis (ggplot)

leveneTest

{car}

Computes Levene’s test for homogeneity of variance across groups.

ggplot

{GGPLOT2}

Create a ggplot graph

mutate

{dplyr}

Modify/create a column in a data frame

resid

{stats}

Extracts model residuals from objects returned by modeling functions

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

select

{dplyr}

Select columns from a tibble/data frame

confint

{stats}

Calculate confidence Intervals for Model Parameters

ifelse

{base}

Return a or b depending on the value of test

is.element

{base}

Check if a value is element of a vector

attach

{base}

Attach Set of R Objects to Search Path

relevel

{stats}

Reorder Levels of Factor

vcovHC

{sandwich}

Heteroscedasticity-consistent estimation of the covariance matrix of the coefficient estimates

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

pchisq

{stats}

Gives the distribution function of the chi-squared distribution

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

summary

{base}

Obtain summary statistics or detailed regression output

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

filter

{dplyr}

Filter out rows of a data frame according to logical vector

stargazer

{stargazer}

Create a regression output table

sample_frac

{dplyr}

Sample a fraction of observations from a data frame

as.character

{base}

Coerce a vector to character

lm

{base}

Fit a linear model

droplevels

{base}

Drop Unused Levels from Factors

as.numeric

{base}

Coerce a vector to numeric

names

{base}

Retrieve names of a list/vector

The end!